package com.apex.restful.domain;
import com.apex.entity.TBsdtSysResources;
import com.edu.orm.repository.CustomRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * Created by 18424 on 2017/7/11.
 */
public interface MenuResourceRepository extends CustomRepository<TBsdtSysResources,Long > {

    @Query("select t from TBsdtSysResources t where t.type=:type and t.state = '1' order by t.ordernum desc ")
    List<TBsdtSysResources> queryByTypeAndState(@Param("type") Long type);

    @Query("select t from TBsdtSysResources t where t.state = '1' and t.parentid =:parentId order by t.ordernum desc ")
    List<TBsdtSysResources> queryAllChildByStateAndType(@Param("parentId") Long parentId);

}
